<template>

	<el-row :gutter="20" style="margin-top:100px;">
	  	<el-col :span="12" :offset="6">
	  		<el-card class="box-card">
	  			<div slot="header" >
				    登录
				</div>

			  	<el-form :model="form" label-width="80px">
					<el-form-item label="用户名">
						<el-input v-model="form.username"></el-input>
					</el-form-item>

					<el-form-item label="密码">
						<el-input type="password" v-model="form.password"></el-input>
					</el-form-item>

				  	<el-form-item >
				    	<el-button type="primary" @click="gogo">登录</el-button>
				  	</el-form-item>

				</el-form>
			</el-card>
	  	</el-col>
	</el-row>
  		
</template>

<script>

import { mapGetters } from 'vuex'

export default {
	name: 'login',
		data () {
		return {
		  	form : {
		  		'username' : '',
		  		'password' : '',
		  	}
		}
	},

	components: {

		
	},

	computed : {
		
	},

	methods : {

		gogo () {

			var para = {
				fun : 'login',
				username : this.form.username,
				password : this.form.password,
				requestType : 'get',
				cb : res => {
					console.log(res);
					this.$router.push({ 
						name: 'test', 
					});
				}
			};

			this.$store.dispatch('update', para);
		}
	},

	watch:{
	    
	},

	created () {
	},

}
</script>

<style scoped>

</style>
